<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GMimeStream: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="Streams.html" title="Streams">
<link rel="prev" href="Streams.html" title="Streams">
<link rel="next" href="GMimeStreamFile.html" title="GMimeStreamFile">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GMimeStream.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GMimeStream.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="Streams.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="Streams.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GMimeStreamFile.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GMimeStream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GMimeStream.top_of_page"></a>GMimeStream</span></h2>
<p>GMimeStream — Abstract stream class</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GMimeStream.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-construct" title="g_mime_stream_construct ()">g_mime_stream_construct</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">ssize_t</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-read" title="g_mime_stream_read ()">g_mime_stream_read</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">ssize_t</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-write" title="g_mime_stream_write ()">g_mime_stream_write</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-flush" title="g_mime_stream_flush ()">g_mime_stream_flush</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-seek" title="g_mime_stream_seek ()">g_mime_stream_seek</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-tell" title="g_mime_stream_tell ()">g_mime_stream_tell</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-reset" title="g_mime_stream_reset ()">g_mime_stream_reset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-eos" title="g_mime_stream_eos ()">g_mime_stream_eos</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-close" title="g_mime_stream_close ()">g_mime_stream_close</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-length" title="g_mime_stream_length ()">g_mime_stream_length</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GMimeStream.html" title="GMimeStream"><span class="returnvalue">GMimeStream</span></a> *
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-substream" title="g_mime_stream_substream ()">g_mime_stream_substream</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-set-bounds" title="g_mime_stream_set_bounds ()">g_mime_stream_set_bounds</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">ssize_t</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-write-string" title="g_mime_stream_write_string ()">g_mime_stream_write_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">ssize_t</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-printf" title="g_mime_stream_printf ()">g_mime_stream_printf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-write-to-stream" title="g_mime_stream_write_to_stream ()">g_mime_stream_write_to_stream</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint64</span>
</td>
<td class="function_name">
<a class="link" href="GMimeStream.html#g-mime-stream-writev" title="g_mime_stream_writev ()">g_mime_stream_writev</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GMimeStream.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GMimeStream.html#GMimeSeekWhence" title="enum GMimeSeekWhence">GMimeSeekWhence</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GMimeStream.html#GMimeStreamIOVector" title="GMimeStreamIOVector">GMimeStreamIOVector</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GMimeStream.html#GMimeStream-struct" title="struct GMimeStream">GMimeStream</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GMimeStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GMimeStream
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamBuffer.html" title="GMimeStreamBuffer">GMimeStreamBuffer</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamCat.html" title="GMimeStreamCat">GMimeStreamCat</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamFile.html" title="GMimeStreamFile">GMimeStreamFile</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamFilter.html" title="GMimeStreamFilter">GMimeStreamFilter</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamFs.html" title="GMimeStreamFs">GMimeStreamFs</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamGIO.html" title="GMimeStreamGIO">GMimeStreamGIO</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamMem.html" title="GMimeStreamMem">GMimeStreamMem</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamMmap.html" title="GMimeStreamMmap">GMimeStreamMmap</a>
        <span class="lineart">├──</span> <a class="link" href="GMimeStreamNull.html" title="GMimeStreamNull">GMimeStreamNull</a>
        <span class="lineart">╰──</span> <a class="link" href="GMimeStreamPipe.html" title="GMimeStreamPipe">GMimeStreamPipe</a>
</pre>
</div>
<div class="refsect1">
<a name="GMimeStream.description"></a><h2>Description</h2>
<p>Streams are the fundamental method for reading and writing data
used by GMime. You'll probably notice that the basic API is similar
to that of the low-level Unix I/O layer (<code class="function">read()</code>, <code class="function">write()</code>, <code class="function">lseek()</code>,
etc) with some additional nicities such as a printf-like function.</p>
</div>
<div class="refsect1">
<a name="GMimeStream.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-mime-stream-construct"></a><h3>g_mime_stream_construct ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_stream_construct (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                         <em class="parameter"><code><span class="type">gint64</span> start</code></em>,
                         <em class="parameter"><code><span class="type">gint64</span> end</code></em>);</pre>
<p>Initializes a new stream with bounds <em class="parameter"><code>start</code></em>
 and <em class="parameter"><code>end</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-construct.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start</p></td>
<td class="parameter_description"><p>start boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end</p></td>
<td class="parameter_description"><p>end boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-read"></a><h3>g_mime_stream_read ()</h3>
<pre class="programlisting"><span class="returnvalue">ssize_t</span>
g_mime_stream_read (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                    <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
                    <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Attempts to read up to <em class="parameter"><code>len</code></em>
 bytes from <em class="parameter"><code>stream</code></em>
 into <em class="parameter"><code>buf</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-read.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>buffer. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> length=len][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> guint8]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-read.returns"></a><h4>Returns</h4>
<p> the number of bytes read or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-write"></a><h3>g_mime_stream_write ()</h3>
<pre class="programlisting"><span class="returnvalue">ssize_t</span>
g_mime_stream_write (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                     <em class="parameter"><code>const <span class="type">char</span> *buf</code></em>,
                     <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Attempts to write up to <em class="parameter"><code>len</code></em>
 bytes of <em class="parameter"><code>buf</code></em>
 to <em class="parameter"><code>stream</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-write.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>buffer length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-write.returns"></a><h4>Returns</h4>
<p> the number of bytes written or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-flush"></a><h3>g_mime_stream_flush ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
g_mime_stream_flush (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Sync's the stream to disk.</p>
<div class="refsect3">
<a name="g-mime-stream-flush.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-flush.returns"></a><h4>Returns</h4>
<p> <code class="literal">0</code> on success or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-seek"></a><h3>g_mime_stream_seek ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
g_mime_stream_seek (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                    <em class="parameter"><code><span class="type">gint64</span> offset</code></em>,
                    <em class="parameter"><code><a class="link" href="GMimeStream.html#GMimeSeekWhence" title="enum GMimeSeekWhence"><span class="type">GMimeSeekWhence</span></a> whence</code></em>);</pre>
<p>Repositions the offset of the stream <em class="parameter"><code>stream</code></em>
 to
the argument <em class="parameter"><code>offset</code></em>
 according to the
directive <em class="parameter"><code>whence</code></em>
 as follows:</p>
<p>    <a class="link" href="GMimeStream.html#GMIME-STREAM-SEEK-SET:CAPS"><span class="type">GMIME_STREAM_SEEK_SET</span></a>: Seek <em class="parameter"><code>offset</code></em>
 bytes relative to
    the beginning (bound_start) of the stream.</p>
<p>    <a class="link" href="GMimeStream.html#GMIME-STREAM-SEEK-CUR:CAPS"><span class="type">GMIME_STREAM_SEEK_CUR</span></a>: Seek <em class="parameter"><code>offset</code></em>
 bytes relative to the
    current offset of the stream.</p>
<p>    <a class="link" href="GMimeStream.html#GMIME-STREAM-SEEK-END:CAPS"><span class="type">GMIME_STREAM_SEEK_END</span></a>: Seek <em class="parameter"><code>offset</code></em>
 bytes relative to the
    end of the stream (bound_end if non-negative).</p>
<div class="refsect3">
<a name="g-mime-stream-seek.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>offset</p></td>
<td class="parameter_description"><p>positional offset</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>whence</p></td>
<td class="parameter_description"><p>seek directive</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-seek.returns"></a><h4>Returns</h4>
<p> the resultant position on success or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-tell"></a><h3>g_mime_stream_tell ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
g_mime_stream_tell (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Gets the current offset within the stream.</p>
<div class="refsect3">
<a name="g-mime-stream-tell.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-tell.returns"></a><h4>Returns</h4>
<p> the current position within the stream or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-reset"></a><h3>g_mime_stream_reset ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
g_mime_stream_reset (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Resets the stream.</p>
<div class="refsect3">
<a name="g-mime-stream-reset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-reset.returns"></a><h4>Returns</h4>
<p> <code class="literal">0</code> on success or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-eos"></a><h3>g_mime_stream_eos ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g_mime_stream_eos (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Tests the end-of-stream indicator for <em class="parameter"><code>stream</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-eos.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-eos.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> on EOS or <code class="literal">FALSE</code> otherwise.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-close"></a><h3>g_mime_stream_close ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
g_mime_stream_close (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Closes the stream.</p>
<div class="refsect3">
<a name="g-mime-stream-close.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-close.returns"></a><h4>Returns</h4>
<p> <code class="literal">0</code> on success or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-length"></a><h3>g_mime_stream_length ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
g_mime_stream_length (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>);</pre>
<p>Gets the length of the stream.</p>
<div class="refsect3">
<a name="g-mime-stream-length.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-length.returns"></a><h4>Returns</h4>
<p> the length of the stream or <code class="literal">-1</code> if unknown.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-substream"></a><h3>g_mime_stream_substream ()</h3>
<pre class="programlisting"><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="returnvalue">GMimeStream</span></a> *
g_mime_stream_substream (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                         <em class="parameter"><code><span class="type">gint64</span> start</code></em>,
                         <em class="parameter"><code><span class="type">gint64</span> end</code></em>);</pre>
<p>Creates a new substream of <em class="parameter"><code>stream</code></em>
 with bounds <em class="parameter"><code>start</code></em>
 and <em class="parameter"><code>end</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-substream.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start</p></td>
<td class="parameter_description"><p>start boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end</p></td>
<td class="parameter_description"><p>end boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-substream.returns"></a><h4>Returns</h4>
<p>a substream of <em class="parameter"><code>stream</code></em>
with bounds <em class="parameter"><code>start</code></em>
and <em class="parameter"><code>end</code></em>
. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-set-bounds"></a><h3>g_mime_stream_set_bounds ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_stream_set_bounds (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                          <em class="parameter"><code><span class="type">gint64</span> start</code></em>,
                          <em class="parameter"><code><span class="type">gint64</span> end</code></em>);</pre>
<p>Set the bounds on a stream.</p>
<div class="refsect3">
<a name="g-mime-stream-set-bounds.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start</p></td>
<td class="parameter_description"><p>start boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end</p></td>
<td class="parameter_description"><p>end boundary</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-write-string"></a><h3>g_mime_stream_write_string ()</h3>
<pre class="programlisting"><span class="returnvalue">ssize_t</span>
g_mime_stream_write_string (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                            <em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>Writes <em class="parameter"><code>string</code></em>
 to <em class="parameter"><code>stream</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-write-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>string to write</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-write-string.returns"></a><h4>Returns</h4>
<p> the number of bytes written or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-printf"></a><h3>g_mime_stream_printf ()</h3>
<pre class="programlisting"><span class="returnvalue">ssize_t</span>
g_mime_stream_printf (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                      <em class="parameter"><code>const <span class="type">char</span> *fmt</code></em>,
                      <em class="parameter"><code>...</code></em>);</pre>
<p>Write formatted output to a stream.</p>
<div class="refsect3">
<a name="g-mime-stream-printf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>fmt</p></td>
<td class="parameter_description"><p>format</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-printf.returns"></a><h4>Returns</h4>
<p> the number of bytes written or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-write-to-stream"></a><h3>g_mime_stream_write_to_stream ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
g_mime_stream_write_to_stream (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *src</code></em>,
                               <em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *dest</code></em>);</pre>
<p>Attempts to write the source stream to the destination stream.</p>
<div class="refsect3">
<a name="g-mime-stream-write-to-stream.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>source stream</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>destination stream</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-write-to-stream.returns"></a><h4>Returns</h4>
<p> the number of bytes written or <code class="literal">-1</code> on fail.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-stream-writev"></a><h3>g_mime_stream_writev ()</h3>
<pre class="programlisting"><span class="returnvalue">gint64</span>
g_mime_stream_writev (<em class="parameter"><code><a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a> *stream</code></em>,
                      <em class="parameter"><code><a class="link" href="GMimeStream.html#GMimeStreamIOVector" title="GMimeStreamIOVector"><span class="type">GMimeStreamIOVector</span></a> *vector</code></em>,
                      <em class="parameter"><code><span class="type">size_t</span> count</code></em>);</pre>
<p>Writes at most <em class="parameter"><code>count</code></em>
 blocks described by <em class="parameter"><code>vector</code></em>
 to <em class="parameter"><code>stream</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-stream-writev.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>stream</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html" title="GMimeStream"><span class="type">GMimeStream</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>vector</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeStream.html#GMimeStreamIOVector" title="GMimeStreamIOVector"><span class="type">GMimeStreamIOVector</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>count</p></td>
<td class="parameter_description"><p>number of vector elements</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-stream-writev.returns"></a><h4>Returns</h4>
<p> the number of bytes written or <code class="literal">-1</code> on fail.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GMimeStream.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GMimeSeekWhence"></a><h3>enum GMimeSeekWhence</h3>
<p>Relative seek position.</p>
<div class="refsect3">
<a name="GMimeSeekWhence.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GMIME-STREAM-SEEK-SET:CAPS"></a>GMIME_STREAM_SEEK_SET</p></td>
<td class="enum_member_description">
<p>Seek relative to the beginning of the stream.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-STREAM-SEEK-CUR:CAPS"></a>GMIME_STREAM_SEEK_CUR</p></td>
<td class="enum_member_description">
<p>Seek relative to the current position in the stream.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-STREAM-SEEK-END:CAPS"></a>GMIME_STREAM_SEEK_END</p></td>
<td class="enum_member_description">
<p>Seek relative to the end of the stream.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMimeStreamIOVector"></a><h3>GMimeStreamIOVector</h3>
<pre class="programlisting">typedef struct {
	void *data;
	size_t len;
} GMimeStreamIOVector;
</pre>
<p>An I/O vector for use with <a class="link" href="GMimeStream.html#g-mime-stream-writev" title="g_mime_stream_writev ()"><code class="function">g_mime_stream_writev()</code></a>.</p>
<div class="refsect3">
<a name="GMimeStreamIOVector.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">void</span> *<em class="structfield"><code><a name="GMimeStreamIOVector.data"></a>data</code></em>;</p></td>
<td class="struct_member_description"><p>data to pass to the I/O function.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">size_t</span> <em class="structfield"><code><a name="GMimeStreamIOVector.len"></a>len</code></em>;</p></td>
<td class="struct_member_description"><p>length of the data, in bytes.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMimeStream-struct"></a><h3>struct GMimeStream</h3>
<pre class="programlisting">struct GMimeStream;</pre>
<p>Abstract I/O stream class.</p>
<div class="refsect3">
<a name="GMimeStream.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody></tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>